Follow up GH-357 in the documentation of Element#attribute - #367
Merged
Conversation
rubyGH-360 documented REXML::Element#attribute as matching a namespace loosely, and said an unprefixed attribute is taken to be in the default namespace. rubyGH-357 made the method ask REXML::Attributes#get_attribute_ns first, so that is now only true when nothing matches strictly: <root xmlns='ns0' xmlns:p='ns0' a='A' p:a='PA'/> attribute("a", "ns0") -> p:a='PA', not a='A' The two examples in the note still hold, because neither document has a prefixed attribute of the same local name for the strict match to find. It is the rule stated around them that no longer holds: an unprefixed attribute is taken to be in the default namespace only when nothing matches strictly. Describe the method the way it now works -- strict first, then the compatibility fallback -- and add the example above, which is the only place the change is visible. Say of get_attribute_ns that it matches strictly and only strictly, rather than pointing at it as the way to match strictly, now that Element#attribute starts there too.
Member
|
Thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GH-360 documented
REXML::Element#attributeas matching a namespace loosely, and said an unprefixed attribute is taken to be in the default namespace. GH-357 made the method askREXML::Attributes#get_attribute_ns first, so that is now only true when nothing matches strictly:
The two examples in the note still hold, because neither document has a prefixed attribute of the same local name for the strict match to find. It is the rule stated around them that no longer holds: an unprefixed attribute is taken to be in the default namespace only when nothing matches strictly.
Describe the method the way it now works -- strict first, then the compatibility fallback -- and add the example above, which is the only place the change is visible. Say of get_attribute_ns that it matches strictly and only strictly, rather than pointing at it as the way to match strictly, now that Element#attribute starts there too.